package com.mjr.webmanage.controller;

import com.mjr.webmanage.pojo.JobOption;
import com.mjr.webmanage.pojo.Result;
import com.mjr.webmanage.service.ReportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RequestMapping("/report")
@RestController
public class ReportController {

    @Autowired
    private ReportService reportService;

    @GetMapping("/empJobData")
    public Result empJobData() {

        log.info("统计员工职位");

        JobOption jobOption = reportService.empJobData();

        return Result.success(jobOption);
    }


    @GetMapping("/empGenderData")
    public Result empGenderData() {
        log.info("统计员工性别");
        return Result.success(reportService.getGenderData());
    }
}
